<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

/*Route::get('/', function () {
    return view('welcome');
});*/

Route::group(['middleware' => 'web'], function () {
    Route::get('/tt', function () {
        Session::put('test', 'testing');
    });

    Route::get('/other', function () {
        dd(Session::get('test'));
    });
});

Route::get('/','Controller@index');

/*Route::get('/articleDetail/{articleId}.html','Controller@articleDetail');*/

Route::get('/picture','Controller@picture_index');

Route::get('/pictureDetail/{pictureId}.html','Controller@pictureDetail');

Route::post('/doComment','Controller@doComment');

Route::post('/doCommentByReply','Controller@doCommentByReply');

Route::get('/test','Controller@test_index');

Route::get('/testDetail/{testId}.html','Controller@testDetail');

Route::post('/test/getResult','Controller@getResult');

Route::get('/story','Controller@story_index');

Route::get('/storyDetail/{storyId}.html','Controller@storyDetail');

Route::get('/story/{typeId}','Controller@storyByType');

Route::get('/about','Controller@about');


Route::get('/admin/login','AdminController@login');

Route::post('/doLogin','AdminController@doLogin');


Route::group(["middleware" => 'login'], function() {

    Route::get('/admin','AdminController@index');

    Route::get('/adminManage','AdminController@admin');

    Route::get('/admin/getAllAdmin','AdminController@getAllAdmin');

    Route::get('/addAdmin','AdminController@addAdmin');

    Route::post('/saveAdmin','AdminController@saveAdmin');

    Route::post('/deleteAdmin','AdminController@deleteAdmin');

    Route::get('/updateAdmin','AdminController@updateAdmin');

    Route::post('/doUpdateAdmin','AdminController@doUpdateAdmin');


    Route::get('/adminOperateManage','AdminController@adminOperate');

    Route::get('/admin/getAllAdminOperate','AdminController@getAllAdminOperate');



    Route::get('/articleManage','AdminController@article');

    Route::get('/admin/getAllArticle','AdminController@getAllArticle');

    Route::get('/addArticle','AdminController@addArticle');

    Route::post('/saveArticle','AdminController@saveArticle');

    Route::post('/deleteArticle','AdminController@deleteArticle');

    Route::get('/updateArticle','AdminController@updateArticle');

    Route::post('/doUpdateArticle','AdminController@doUpdateArticle');



    Route::get('/articleTypeManage','AdminController@articleType');

    Route::get('/admin/getAllArticleType','AdminController@getAllArticleType');

    Route::get('/addArticleType','AdminController@addArticleType');

    Route::post('/saveArticleType','AdminController@saveArticleType');

    Route::post('/deleteArticleType','AdminController@deleteArticleType');

    Route::get('/updateArticleType','AdminController@updateArticleType');

    Route::post('/doUpdateArticleType','AdminController@doUpdateArticleType');



    Route::get('/pictureManage','AdminController@picture');

    Route::get('/admin/getAllPicture','AdminController@getAllPicture');

    Route::get('/addPicture','AdminController@addPicture');

    Route::post('/savePicture','AdminController@savePicture');

    Route::post('/deletePicture','AdminController@deletePicture');

    Route::get('/updatePicture','AdminController@updatePicture');

    Route::post('/doUpdatePicture','AdminController@doUpdatePicture');


    Route::get('/testManage','AdminController@test');

    Route::get('/admin/getAllTest','AdminController@getAllTest');

    Route::get('/addTest','AdminController@addTest');

    Route::post('/saveTest','AdminController@saveTest');

    Route::post('/deleteTest','AdminController@deleteTest');

    Route::get('/updateTest','AdminController@updateTest');

    Route::post('/doUpdateTest','AdminController@doUpdateTest');


    Route::get('/admin/testResultManage','AdminController@testResult');

    Route::get('/admin/getAllTestResult','AdminController@getAllTestResult');

    Route::get('/addTestResult','AdminController@addTestResult');

    Route::post('/saveTestResult','AdminController@saveTestResult');

    Route::post('/deleteTestResult','AdminController@deleteTestResult');

    Route::get('/updateTestResult','AdminController@updateTestResult');

    Route::post('/doUpdateTestResult','AdminController@doUpdateTestResult');



    Route::get('/storyManage','AdminController@story');

    Route::get('/admin/getAllStory','AdminController@getAllStory');

    Route::get('/addStory','AdminController@addStory');

    Route::post('/saveStory','AdminController@saveStory');

    Route::post('/deleteStory','AdminController@deleteStory');

    Route::get('/updateStory','AdminController@updateStory');

    Route::post('/doUpdateStory','AdminController@doUpdateStory');

    Route::get('/aboutManage','AdminController@about');

    Route::post('/saveAbout','AdminController@saveAbout');
});

Route::get('auth/{service}', 'LoginController@redirectToProvider');
Route::get('auth/{service}/callback', 'LoginController@handleProviderCallback');
Route::get('/loginout', 'LoginController@loginout');
Route::get('/testSession','LoginController@testSession');